<?php
if ( ! defined('BASEPATH')) exit('No direct script access allowed');
require_once BASE_PATH.'application/controllers/base'.EXT;

class Imagen extends Base {
	
       public function __construct()
       {
            parent::__construct();
			$this->load->model("imageDAO");
	      
       }
              
       public function index($size='100x100')
       {
       	
	      if(!empty($size))
	      {
		     if(substr_count($size,"x") > 0) {
				    $size = explode("x",$size);
					$width = $size[0];
					$height = $size[1];
		     }
			 else
			 	$width = $size;
		     
	      }
		  $img =  $this->input->get('i');
	      
	      $this->imageDAO->resize_crop($width, $height, $img);
       }
       
}